home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Free Software Collection 7 / FM Towns Free Software Collection 7.iso / taropyon / guilib3 / inc / wind.h < prev    next >
C/C++ Source or Header  |  1993-11-30  |  4KB  |  120 lines

  1. /*    :*****************************************************************
  2.     :    "wind.h"    :    system“Pride”ウィンドゥ・ライブラリ
  3.     :*****************************************************************
  4. */
  5. #ifndef    _WIND_H
  6. #define    _WIND_H
  7.  
  8. #ifndef    _GUIDEFS_H
  9. #    include    <guidefs.h>
  10. #endif
  11. #ifndef    _TIME_H
  12. #    include    <time.h>
  13. #endif
  14.  
  15. #define    WINSTT_SLEEP    (-1)    /* おやすみ    */
  16. #define    WINSTT_OFF        (0)        /* 非表示中    */
  17. #define    WINSTT_DSP        (1)        /* 表示中    */
  18.  
  19. typedef    struct    _winfr
  20. {
  21.     struct    _winfr    *next;
  22.     FRAME            fr;
  23. } WINFR_T;
  24.  
  25. typedef    struct
  26. {
  27.     char        *mskBuf;        /* 画面マスク用バッファ        */
  28.     size_t        mskSiz;            /* マスク領域のサイズ        */
  29.     FRAME        vramFr;            /* VRAMの大きさ                */
  30.     WINFR_T        *dspFr;            /* 描画範囲                    */
  31.     WINFR_T        *mskFr;            /* マスク範囲                */
  32.  
  33. } WINDSP_T;
  34.  
  35. typedef    struct    _win_t
  36. {
  37.     struct _win_t    *next;
  38.     struct _win_t    *link;
  39.     struct _win_t    *back;
  40.  
  41.     int            id;                /* ID number                        */
  42.     int            stt;            /* ステータス                        */
  43.     int            prio;            /* プライオリティ(not use)            */
  44.     FRAME        fr;                /* ウィンドゥ枠                        */
  45.     WINDSP_T    winDsp;            /* 表示ワーク用                        */
  46.     time_t        updateTime;        /* 更新時間                            */
  47.     int            accChk;            /* アクセスチェック                    */
  48.     void        (*func)( struct _win_t *, int);
  49.                                 /* 描画関数                            */
  50.     void        *ptr;            /* 描画関数用のパラメータポインタ    */
  51. } WIN_T;
  52. #define    WIN_ID    WIN_T
  53.  
  54. typedef    struct _winsys_t    /* ベースウィンドゥ管理構造体    */
  55. {
  56.     WIN_T        *top;            /* 先頭ウィンドゥ            */
  57.     WIN_T        *act;            /* アクティブウィンドゥ        */
  58.     int            page;            /* 書き込みページ            */
  59.     FRAME        fr;                /* ウィンドゥ範囲            */
  60.  
  61.     char        *mskBuf;        /* 画面マスク用バッファ        */
  62.     size_t        mskSiz;            /* マスク領域のサイズ        */
  63.     FRAME        vramFr;            /* VRAMの大きさ                */
  64.     WINFR_T        *dspFr;            /* 描画範囲                    */
  65.     WINFR_T        *mskFr;            /* マスク範囲                */
  66.     int            accChk;            /* アクセスチェック            */
  67.     int            (*func)(struct _winsys_t *, FRAME *);
  68.                                 /* ベース画面描画実行関数    */
  69.     void        *ptr;            /* ユーザー用汎用ポインタ    */
  70. } WINSYS_T;
  71. #define    WINSYS    WINSYS_T
  72.  
  73. /*    非表示状態のウィンドゥもマッチ    */
  74. #define    WINCHKSTT(stt)    ( ((stt)&0x80)==0 && (stt)>=0 )
  75.  
  76. /*    完全表示中のものだけ    */
  77. #define    WINCHKSTT2(stt)    ( ((stt)&0x80)==0 && (stt)> 0 )
  78.  
  79.  
  80. extern    WINSYS_T    *WIN_init( int page, int x1, int y1, int x2, int y2, int (*func)(WINSYS_T *,FRAME *), void *ptr );
  81. extern    int        WIN_drawBaseScrn( WINSYS_T *wsys, FRAME *fr );
  82. extern    int        WIN_delBase( WINSYS_T *winSys );
  83. extern    void    WIN_redraw( WINSYS_T *wsys );
  84. extern    WIN_T    *WIN_select( WINSYS_T *wsys, int x, int y);
  85. extern    WIN_T    *WIN_open( WINSYS_T *wsys, int id, int x1, int y1, int x2, int y2, void (*func)(WIN_T *,int), void *ptr );
  86. extern    WIN_T    *WIN_childOpen( WINSYS_T *wsys, WIN_T *parentWin, int x1, int y1, int x2, int y2, void (*func)(WIN_T *,int), void *ptr  );
  87. extern    int        WIN_dsp( WINSYS_T *wsys, WIN_T *win );
  88. extern    int        WIN_active( WINSYS_T *wsys, WIN_T *win );
  89. extern    int        WIN_sleep( WINSYS_T *wsys, WIN_T *win);
  90. extern    int        WIN_close( WINSYS_T *wsys, WIN_T *win );
  91. extern    int        WIN_childClose( WINSYS_T *wsys, WIN_T *win, WIN_T *childWin );
  92. extern    int        WIN_resize( WINSYS_T *wsys, WIN_T *win, int x1, int y1, int x2, int y2 );
  93. extern    int        WIN_move( WINSYS_T *wsys, WIN_T *win, int x0, int y0 );
  94.  
  95.  
  96. /*    "win020.c"        ------------------------------------------------*/
  97. #define    WIN_ANI_CLK        (48*CLOCKS_PER_SEC/100)
  98. #define    WIN_ANI_CLK2    (26*CLOCKS_PER_SEC/100)
  99. #define    WinMoveAnime(newFr,oldFr,clk)    \
  100.         BoxMoveAnime( (newFr), (oldFr), DspCtrl.writePage, (clk) )
  101.  
  102. extern    int        WinResize( FRAME *fr, int xmax, int xmin, int ymax, int ymin );
  103. extern    int        WinMove2( FRAME *fr, int xdt , int ydt );
  104. extern    int        WinMove( FRAME *fr );
  105.  
  106. /*    "win021.c"        ------------------------------------------------*/
  107. extern    int        WinCorrectMove( FRAME *ar, FRAME *fr );
  108.  
  109. /*    "win031.c"        ------------------------------------------------*/
  110. extern    int        WinChkOnFrame( WINSYS_T *wsys, WIN_T *win, FRAME *fr );
  111. extern    int        WinChkOnArea( WINSYS_T *wsys, WIN_T *win, int x1, int y1, int x2, int y2 );
  112.  
  113. /*    "win040.c"        ------------------------------------------------*/
  114.  
  115. extern    void    WinFreeDspWork( WIN_T *win );
  116. extern    int        WinSetDspWork( WINSYS_T *wsys, WIN_T *win );
  117. extern    int        WinDspChkOnFrame( WINSYS_T *wsys, WIN_T *win, REG FRAME *fr );
  118.  
  119. #endif
  120.